package com.jtpay.ysfproductionprocess.http.service;

import com.google.gson.JsonObject;
import com.jtpay.ysfproductionprocess.http.dataStructure.BasicResponse;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.*;

import java.util.Map;

/**
 * Created by Administrator on 2018/1/15.
 */

public interface ApiInterface {
    @Headers("Content-Type:multipart/form-data")
    @POST()
    Observable<BasicResponse<JsonObject>> postJsonBodyFileUpload(@Url String url, @Body RequestBody requestBody);

    @Headers("Content-Type:application/json;charset=UTF-8")
//    @Headers({"Content-Type:application/json;charset=UTF-8", "Connection:close"})
    @POST()
    Observable<BasicResponse<JsonObject>> postJsonBody(@Url String url, @Body RequestBody requestBody);

    @Headers("Content-Type:application/json;charset=UTF-8")
    //    @Headers({"Content-Type:application/json;charset=UTF-8", "Connection:close"})
    @GET()
    Observable<BasicResponse<JsonObject>> getJsonMap(@Url String url, @QueryMap Map<String, String> params);

    @Headers("Content-Type:text/plain;charset=UTF-8")
//    @Headers({"Content-Type:text/plain;charset=UTF-8", "Connection:close"})
//    @Headers("Content-Type:application/json;charset=UTF-8")
    @POST()
    Observable<BasicResponse<String>> postStrObject(@Url String url, @Body Object object);

    @Headers("Content-Type:text/plain;charset=UTF-8")
//    @Headers({"Content-Type:text/plain;charset=UTF-8", "Connection:close"})
//    @Headers("Content-Type:application/json;charset=UTF-8")
    @POST()
    Observable<BasicResponse<JsonObject>> postJsonObject(@Url String url, @Body Object object);

    @Headers("Content-Type:text/plain;charset=UTF-8")
//    @Headers({"Content-Type:text/plain;charset=UTF-8", "Connection:close"})
    @GET()
    Observable<BasicResponse<String>> getStrMap(@Url String url, @QueryMap Map<String, String> params);

}